/*
 * AbstractDocument Class.
 */
package conference;

import java.util.Date;

/**
 * Represents a Abstract Document.
 * @author Allison Graham and Katie Park
 * @version 1.0
 * Represents an abstract document class to be extended
 * by Manuscript and Review classes. Designed for TCSS
 * 360, Fall 2011.
 */
public abstract class AbstractDocument implements Document{
    private String myTitle;/**The title of the document.*/
    private String myFileContents; /**The File containing the text document.*/
    private User myCreator;/**The user for this document.*/
    private Date myDate; /** The date this document was created.*/
    
    /**
     * Constructs an instance of an AbstractDocument given a title, A string representation of the text, and a User as creator of the file.
     * -precondition : none.
     * -postcondition : myTitle == theTitle.
     * -postcondition : myCreator == theCreator.
     * -postcondition : myFileContents == theFileContents
     * -postcondition : myDate == Cureent Date.
     * @param theTitle The title of this document.
     * @param theFile The file holding the text of this document.
     * @param theCreator The creator of this document.
     */
    protected AbstractDocument(final String theTitle, final String theFileContents,
            final User theCreator) {
        myTitle = theTitle;
        myCreator = theCreator;
        myFileContents = theFileContents;
        myDate = new Date(System.currentTimeMillis());
    }
    
    /**
     * Creates an AbstractDocument with only a user.
     * -precondition : none.
     * -postcondition : myCreator == theUser.
     * @param theUser The creator of this document.
     */
    protected AbstractDocument(final User theUser) {
    	myCreator = theUser;
    }
    
    /**
     * Returns the title of the document.
     * -pre/postcondiiton : none.
     * @return myTitle Returns the title of this document.
     */
    public final String getTitle() {
        return myTitle;
    }
    
    /**
     * Returns the text file for this document.
     * pre/postcondition : none.
     * @return the myFile Returns the current file for this document.
     */
    public final String getFileContents() {
        return myFileContents;
    }
    
    /**
     * Returns the creator of this document as a user object.
     * @return The creator as a user.
     */
    public final User getCreator() {
        return myCreator;
    }
    
    /**
     * Returns the Date this document was submitted.
     * @return The Date this document was submitted as Date.
     */
    public final Date getSubmissionDate() {
    	return myDate;
    }
}